const SQLiteUtils = require('./SQLiteUtils');
const TokenInfo = require('../sqlite/entity/TokenInfo');
const ConfigInfo = require('../sqlite/entity/ConfigInfo');
const AccountInfo = require('../sqlite/entity/AccountInfo');

const db = new SQLiteUtils('mydatabase.db'); // 创建 SQLite 实例

const tokenModel = new TokenInfo(db);
const configModel = new ConfigInfo(db);
const accountModel = new AccountInfo(db);

const runOperations = async () => {

    const accountData = {
        google_account: 'user123',
        google_password: 'password123',
        x_account: 'x_user',
        x_password: 'x_password',
        dc_account: 'dc_user',
        dc_password: 'dc_password',
        wallet_address: '0xabcdef',
        wallet_private_key: '0xprivatekey',
        wallet_words_key: 'wordskey',
        sol_address: '0xsoladdress',
        sol_private_key: '0xsolprivatekey',
        sol_words_key: 'solwordskey',
        tel_address: 'teladdress',
        tel_password: 'telpassword',
        sol_push_address: '0xpushaddress'
      };
      const accountId = await accountModel.insert(accountData);
      console.log(`Inserted account with ID: ${accountId}`);
     // 查询 config
     const config = await configModel.getByName('API_KEY');
     const accountInfo = await accountModel.get_by_solana_address('0xsoladdress')
     console.log(config)
     console.log(accountInfo)
    
};

runOperations();
